package com.lyw.config;

import com.lyw.interceptors.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyWebMvcConfigerur implements WebMvcConfigurer {

  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(new LoginInterceptor())
            .excludePathPatterns("/css/*", "/js/*", "/fonts/*",
                    "/font-awesome-4.7.0/*", "/icons-reference/*", "/img/*", "/", "/login")
            .addPathPatterns("/*");
  }
}
